<?php include_once 'group_header.php';?>

    <div class="main_left">
    	<div class="group_new_title"><h2>创建微群</h2> ( 您目前还能创建3个微群 ) </div>	
	<?php if ($is_allowed) {  
		if (MEMBER_ROLE_TYPE != 'admin') { ?>
			<div class="qun_tips_2">
				您当前等级可以创建{$detail['ploy_qnum']}个微群,
				<?php if ($detail['my_qnum']) { ?>
					您已经创建了<?php echo $detail['my_qnum'];?>个微群,还可以创建<?php echo $detail['allow_create_num'];?>个
				<?php }else { ?>
					您还没有创建微群呢。赶快创建吧！
				<?php } ?>
			</div>
		<?php } ?>
        <div class="group_new">	
<form method="post" action="index.php?mod=qun&code=docreate" autocomplete="off" id="qun_form" enctype="multipart/form-data" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="60">微群名称：</td>
    <td><input type="text" name="qun_name" id="textfield" class="group_input" /></td>
  </tr>
  <tr>
	<td><label for="color-background">微群分类：</label></td>
	<td>
		<div style="float:left; margin-right:10px;">
			<select id="top_cat" name="top_cat" onchange="get_catselect(this)" style="border:1px solid #cfcfcf;padding:1px;">
				<?php echo $catselect['first']; ?>
			</select>
		</div>
		<div style="float:left; ">
			<select id="sub_cat" name="sub_cat" style="border:1px solid #cfcfcf;padding:1px;">
				<?php echo $catselect['second']; ?>
			</select>
		</div>
	</td>
  </tr>
  <tr>
	<td><label for="color-background">微群标签：</label></td>
	<td>
		<input id="tag" name="tag" value="" type="text" class="group_input" >
		<span style="margin-left:10px;">可以使用空格或英文逗号分隔，最多可填写5个标签</span>
	</td>
	
  </tr>
  <tr>
    <td>微群介绍：</td>
    <td><textarea cols="" rows="3" class="group_textarea" name="desc"></textarea></td>
  </tr>
  <tr>
	<td><label for="color-background">微群类型：</label></td>
	<td>
		<input type="radio" value="0" name="join_type" id="privacy_open" {$checked['join_type'][0]} onclick="privacy_radio_force(2)" />
		<label for="privacy_open">公开群组</label>
		<br />
		<input type="radio" value="1" name="join_type" id="privacy_closed" {$checked['join_type'][1]}/>
		<label for="privacy_closed">私密群组</label>	
	</td>
  </tr>
  <tr>
    <td>所在地：</td>
	<td>
		<div style="width:100px; float:left;">
		<select id="province" name="province" style="border:1px solid #cfcfcf;padding:1px;">
			{$member[province]}
		</select>
		</div>
		<div style="width:100px;float:left; ">
		<select id="city" name="city"></select style="border:1px solid #cfcfcf;padding:1px;">
		</div>
	</td>
  </tr>
  <tr>
    <td>微群头像：</td>
    <td class="group_hand"><img src="templates/app/images/group_new.gif" width="161" height="161" />
    <span>你还没有上传头像<br />
      支持JPG、GIF、PNG图片文件，且小于5M
          <input type="file" name="icon" id="button" value="浏览" class="group_button" /></span></td>
  </tr>
  <tr>
    <td valign="top">加群方式：</td>
    <td>
    	<label for="f01" class="group_label"><input type="radio" name="group_new" id="f01" />自由加入</label><br />
    	<label for="f02" class="group_label"><input type="radio" name="group_new" id="f02" />需要身份验证才能加入</label><br />
    	<label for="f03" class="group_label"><input type="radio" name="group_new" id="f03" />只能由管理员邀请加入</label>
      </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>
      <input type="submit" name="button2" id="button2" value="创建微群" class="group_button" />
    	<a href="index.php?mod=qun">取消</a>
    </td>
  </tr>
</table>
</form>
<script type="text/javascript" src="templates/default/js/city.js"></script>
<script type="text/javascript">
$(function(){
	var selectOption=<?php load::functions('area');echo area_config_to_json(); ?>;
	$("#province").doubleSelect('city',selectOption,{preselectFirst:'<?php echo $member['province']; ?>',preselectSecond:'<?php echo $member[city];?>'});
});
</script>
        </div>
	<?php }else{ ?>
	<div class="qun_tips_2">
		<?php if ($detail['no_avatar']){ ?>
			系统要求上传了头像才能创建微群，请先上传你的头像吧&nbsp;&nbsp;<a href="index.php?mod=settings&code=face" target="_blank">立刻去上传</a>
		<?php }elseif ( $detail['my_qnum'] > 0 && $detail['my_qnum'] ==  $detail['ploy_qnum'] ) { ?>
			你已经达到了你可以创建群的上限了。
		<?php }elseif ( $detail['little_fans'] ) { ?>
			你当前拥有{$detail['my_fans_count']}个粉丝，系统策略要求最少拥有<?php echo $detail['ploy_fans_count'];?>个粉丝才能创建群
		<?php }elseif ( $detail['little_topic'] ) { ?>
			你当前拥有{$detail['my_topic_count']}条微博，系统策略要求最少拥有<?php echo $detail['ploy_topic_count'];?>条微博才能创建群
		<?php }elseif ( $detail['sys_not_allow'] ) { ?>
			系统禁止普通用户创建微群
		<?php } ?>
		<br /> <a href="index.php?mod=topic&code=myhome">返回我的首页</a> <span style="color:#444">|</span> <a href="index.php?mod=qun">返回微群首页</a>
		</div>
	<?php } ?>
    </div>
	
<?php include_once 'group_right.php';?>
